<HTML>
  <HEAD>
    <TITLE>MiAi GO - SGF Page</TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript">
      var djConfig = {parseOnLoad: false, isDebug: true};
    </script>
    <script type="text/javascript" src="/dojo/1.4.0/dojo/dojo.js.uncompressed.js"></script>
    <script type="text/javascript">
      dojo.registerModulePath("miaigo", "/miaigo/js/miaigo");
      dojo.require("miaigo.model.Collection");

      function testSGF()
      {
            var sgf = "(;FF[4]GM[1]SZ[19];B[aa];W[bb](;B[cc];W[dd](;B[ad];W[bd])(;B[ee];W[ff]))(;B[hh];W[hg]))";
            // var sgfURL = "/miaigo/sgf/Kogo%27s%20Joseki%20Dictionary.sgf"
            var sgfURL = "/miaigo/sgf/2bc-32-dwcxx.sgf";
	    var gameCollection = new miaigo.model.Collection();
            // gameCollection.load( {gameString: sgf, gameFormat: "sgf"} );
            gameCollection.load(
            {
              gameURL: sgfURL,
              onError: function(errorString) { alert(errorString); },
              onLoad: function(games) { console.debug(games); },
              onProgress: function(progress) { dojo.byId("startBtn").innerHTML = progress; }
            });
      }

    </script>
  </HEAD>
  <BODY>
    <button id="startBtn" onclick="testSGF();">Start</button>
  </BODY>
</HTML>
